<template>
  <div style="height: 600px">
    <el-container class="home-container">
      <!-- 头部区域 -->
      <el-header>
        <div>
          <span>校园约自习管理系统</span>
        </div>
        <span style="margin-left: 75%">{{info.username}}</span>
        <el-button type="info" @click="logout">退出</el-button>
      </el-header>
      <!-- 页面主体区域 -->
      <el-container>
        <!-- 侧边栏 -->
        <el-aside>
          <!-- 侧边栏菜单区域 -->
          <el-menu background-color="#333744" text-color="#fff" active-text-color="#409EFF" unique-opened
                   :collapse-transition="false" router :default-openeds="['1', '3']">
            <!-- 一级菜单 -->
            <el-menu-item index="teaInformation">
              <template slot="title"><i class="el-icon-paperclip"></i>个人信息</template>
            </el-menu-item>
            <el-menu-item index="teacherGetRoom">
              <template slot="title"><i class="el-icon-paperclip"></i>查询自习室</template>
            </el-menu-item>
            <el-menu-item index="teaGetNotice">
              <template slot="title"><i class="el-icon-paperclip"></i>通知公告</template>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <!-- 右侧内容主体 -->
        <el-main>
          <!-- 路由占位符 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>

</template>

<script>
export default {
  data() {
    return {
      info:{}
    }
  },
  methods: {
    logout(){
      this.$router.push("/")
    },
  },
  mounted() {
    this.info = JSON.parse(sessionStorage.getItem("info"))
  }
}
</script>

<style lang="less" scoped>
.home-container {
  height: 100%;
}
.el-header {
  background-color: #373d41;
  display: flex;
  justify-content: space-between;
  padding-left: 0;
  align-items: center;
  color: #fff;
  font-size: 20px;
  > div {
    display: flex;
    align-items: center;
    span {
      margin-left: 15px;
    }
  }
}

.el-aside {
  background-color: #333744;
  .el-menu {
    border-right: none;
  }
}

.el-main {
  background-color: #eaedf1;
}

.iconfont {
  margin-right: 10px;
}

.toggle-button {
  background-color: #4a5064;
  font-size: 10px;
  line-height: 24px;
  color: #fff;
  text-align: center;
  letter-spacing: 0.2em;
  cursor: pointer;
}
</style>
